<template>
  <u-checkbox shape="square" @change="onCheckboxClick" v-model="isChecked" :name="value">{{
    text
  }}</u-checkbox>
</template>

<script lang="ts">
import { Component, Prop, Vue } from "vue-property-decorator";

@Component({})
export default class DLCheck extends Vue {
  @Prop({
    type: String,
    default: "",
  })
  value: String = ""

  @Prop({
    type: Boolean,
    default: false,
  })
  checked: Boolean = false

  @Prop({
    type: String,
    default: '选项',
  })
  text:String = '选项'

  isChecked: Boolean = this.checked

  onCheckboxClick(e: any) {
    this.$emit("change", {
      value: e.name,
      checked: e.value,
    });
  }
}
</script>
